//
//  ClassifyCollectionViewCell.m
//  MeterMart
//
//  Created by ENERGY on 2018/9/18.
//  Copyright © 2018年 ENERGY. All rights reserved.
//

#import "ClassifyCollectionViewCell.h"

@interface ClassifyCollectionViewCell()
@property (nonatomic, strong)UIImageView * contentImg;
@property (nonatomic, strong)NSString * finequalityID;
@end
@implementation ClassifyCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.contentView.backgroundColor = [UIColor whiteColor];
        __weak typeof (self)weakSelf = self;
        [self.contentView addSubview:self.contentImg];
        [self.contentImg mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.top.bottom.equalTo(weakSelf.contentView);
        }];
    }return self;
}

- (UIImageView *)contentImg{
    if (!_contentImg) {
        _contentImg = [[UIImageView alloc] init];
        _contentImg.image = [UIImage imageNamed:@"YimiPlaceHolder"];
    }return _contentImg;
}

- (void)setModel:(NSDictionary *)model{
    _model = model;
    [self.contentImg sd_setImageWithURL:[NSURL URLWithString:model[@"iconimg"]] placeholderImage:[UIImage imageNamed:@""]];
    self.finequalityID = model[@"id"];
}
- (void)setAdModel:(NSDictionary *)adModel{
    _adModel = adModel;
    [self.contentImg sd_setImageWithURL:[NSURL URLWithString:adModel[@"imgurl"]] placeholderImage:[UIImage imageNamed:@""]];
}
@end
